package XMLread;

import com.google.android.maps.GeoPoint;

/**
 * This object represents a stairwell in a building.
 */
public class Stairwell {
	String stairID;
	private int currentFloor;
	private GeoPoint geopoint;
	
	
	/**
	 * Constructor for this stairwell object.
	 * @param stairID the ID of this stairwell
	 * @param currentFloor the current floor of this stairwell
	 * @param latit the latitude coordinate of this stairwell
	 * @param longit the longitude coordinate of this stairwell
	 */
	public Stairwell(String stairID, int currentFloor, double latit, double longit){
		this.setCurrentFloor(currentFloor);
		setGeopoint(latit, longit);
		this.stairID = stairID;
	}
		
	/**
	 * Returns the location of this stairwell as a GeoPoint.
	 * @return the GeoPoint representing the location of this stairwell.
	 */
	public GeoPoint getGeopoint() {
		return geopoint;
	}
	
	/**
	 * Returns the ID of this stairwell.
	 * @return the ID of this stairwell.
	 */
	public String getStairID(){
		return stairID;
	}

	/**
	 * Sets the position of this stairwell.
	 * @param latitude the new value representing the latitude coordinate of this stairwell.
	 * @param longitude the new value representing the longitude coordinate of this stairwell.
	 */
	public void setGeopoint(double latitude, double longitude) {
		this.geopoint = new GeoPoint((int) (latitude * 1e6), (int) (longitude * 1e6));
	}

	/**
	 * Returns the current floor of this stairwell
	 * @return an int representing the current floor of this stairwell.
	 */
	public int getCurrentFloor() {
		return currentFloor;
	}

	/**
	 * Sets the current floor of this stairwell.
	 * @param floor the new floor of this stairwell.
	 */
	public void setCurrentFloor(int currentFloor) {
		this.currentFloor = currentFloor;
	}	
}
